package com.chen.lifepic;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.chen.lifepic.DataAdapter.HomeDataAdapter;
import com.chen.lifepic.utils.APPCommonDef;

public class HomeActivity extends Activity implements OnItemClickListener{
	ListView mHomeListView;
	HomeDataAdapter mHomeDataAdapter;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.home_activity);
		mHomeListView = (ListView)this.findViewById(R.id.home_activity_listview);
		mHomeListView.setOnItemClickListener(this);
		mHomeDataAdapter = new HomeDataAdapter(this);
		
		mHomeListView.setAdapter(mHomeDataAdapter);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) {
		Intent intent = new Intent(this, LifePic.class);
		intent.putExtra(APPCommonDef.INTENT_GIRL_TYPE, mHomeDataAdapter.getGirlTypeByPosition(position));
		startActivity(intent);
	}
}
